.class Lcom/glympse/android/glympseservice/FacebookWrapper$RequestNameListener$1;
.super Lcom/glympse/platform/GRunnable;
.source "FacebookWrapper.java"


# annotations
.annotation system Ldalvik/annotation/EnclosingMethod;
    value = Lcom/glympse/android/glympseservice/FacebookWrapper$RequestNameListener;->onComplete(Ljava/lang/String;Ljava/lang/Object;)V
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x0
    name = null
.end annotation


# instance fields
.field final synthetic this$1:Lcom/glympse/android/glympseservice/FacebookWrapper$RequestNameListener;

.field private final synthetic val$strResponse:Ljava/lang/String;


# direct methods
.method constructor <init>(Lcom/glympse/android/glympseservice/FacebookWrapper$RequestNameListener;Ljava/lang/String;)V
    .locals 0
    .parameter
    .parameter

    .prologue
    .line 1
    iput-object p1, p0, Lcom/glympse/android/glympseservice/FacebookWrapper$RequestNameListener$1;->this$1:Lcom/glympse/android/glympseservice/FacebookWrapper$RequestNameListener;

    iput-object p2, p0, Lcom/glympse/android/glympseservice/FacebookWrapper$RequestNameListener$1;->val$strResponse:Ljava/lang/String;

    .line 425
    invoke-direct {p0}, Lcom/glympse/platform/GRunnable;-><init>()V

    return-void
.end method


# virtual methods
.method public Run()V
    .locals 5

    .prologue
    .line 431
    :try_start_0
    iget-object v3, p0, Lcom/glympse/android/glympseservice/FacebookWrapper$RequestNameListener$1;->val$strResponse:Ljava/lang/String;

    invoke-static {v3}, Lcom/facebook/android/Util;->parseJson(Ljava/lang/String;)Lorg/json/JSONObject;

    move-result-object v1

    .line 432
    .local v1, oJSON:Lorg/json/JSONObject;
    const-string v3, "name"

    invoke-virtual {v1, v3}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v2

    .line 434
    .local v2, strName:Ljava/lang/String;
    new-instance v3, Ljava/lang/StringBuilder;

    const-string v4, "Facebook name found: "

    invoke-direct {v3, v4}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v3, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v3

    invoke-static {v3}, Lcom/glympse/platform/common/Helpers;->Log(Ljava/lang/String;)V

    .line 437
    invoke-static {}, Lcom/glympse/platform/Platform;->instance()Lcom/glympse/platform/Platform;

    move-result-object v3

    iget-object v3, v3, Lcom/glympse/platform/Platform;->m_oConfig:Lcom/glympse/platform/Config;

    iput-object v2, v3, Lcom/glympse/platform/Config;->m_strFacebookName:Ljava/lang/String;

    .line 438
    invoke-static {}, Lcom/glympse/platform/Platform;->instance()Lcom/glympse/platform/Platform;

    move-result-object v3

    iget-object v3, v3, Lcom/glympse/platform/Platform;->m_oConfig:Lcom/glympse/platform/Config;

    invoke-virtual {v3}, Lcom/glympse/platform/Config;->Save()V
    :try_end_0
    .catch Lcom/facebook/android/FacebookError; {:try_start_0 .. :try_end_0} :catch_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_1

    .line 450
    .end local v1           #oJSON:Lorg/json/JSONObject;
    .end local v2           #strName:Ljava/lang/String;
    :goto_0
    iget-object v3, p0, Lcom/glympse/android/glympseservice/FacebookWrapper$RequestNameListener$1;->this$1:Lcom/glympse/android/glympseservice/FacebookWrapper$RequestNameListener;

    invoke-static {v3}, Lcom/glympse/android/glympseservice/FacebookWrapper$RequestNameListener;->access$0(Lcom/glympse/android/glympseservice/FacebookWrapper$RequestNameListener;)Lcom/glympse/android/glympseservice/FacebookWrapper;

    move-result-object v3

    invoke-static {v3}, Lcom/glympse/android/glympseservice/FacebookWrapper;->access$2(Lcom/glympse/android/glympseservice/FacebookWrapper;)V

    .line 451
    return-void

    .line 440
    :catch_0
    move-exception v3

    move-object v0, v3

    .line 442
    .local v0, e:Lcom/facebook/android/FacebookError;
    invoke-static {v0}, Lcom/glympse/platform/common/Helpers;->Log(Ljava/lang/Throwable;)V

    goto :goto_0

    .line 444
    .end local v0           #e:Lcom/facebook/android/FacebookError;
    :catch_1
    move-exception v3

    move-object v0, v3

    .line 446
    .local v0, e:Ljava/lang/Exception;
    invoke-static {v0}, Lcom/glympse/platform/common/Helpers;->Log(Ljava/lang/Throwable;)V

    goto :goto_0
.end method
